﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <ControlTemplate TargetType="Button" x:Key="commonButton">

        <Border CornerRadius="5" 
                BorderThickness="2"
                Height="{TemplateBinding Height}" 
                Width="{TemplateBinding Width}" >

            <Border.BorderBrush>
                <SolidColorBrush x:Name="BorderColor" Color="#CB11AB"/>
            </Border.BorderBrush>

            <Border.Background>
                <SolidColorBrush x:Name="Background" Color="White"/>
            </Border.Background>


            <ContentControl Margin="{TemplateBinding Margin}"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalAlignment="Center"
                            HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                            Content="{TemplateBinding Content}" 
                            Foreground="{Binding ElementName=BorderColor}"/>

            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup Name="CommonStates">
                    <VisualState Name="MouseOver">
                        <Storyboard>
                            <ColorAnimation Storyboard.TargetName="Background"
                                            Storyboard.TargetProperty="Color" To="#CB11AB"
                                            Duration="0:0:0.15"/>
                            <ColorAnimation Storyboard.TargetName="BorderColor"
                                            Storyboard.TargetProperty="Color" To="White"
                                            Duration="0:0:0.15"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState Name="Normal">
                        <Storyboard>
                            <ColorAnimation Storyboard.TargetName="Background"
                                            Storyboard.TargetProperty="Color" To="White"
                                            Duration="0:0:0.15"/>
                            <ColorAnimation Storyboard.TargetName="BorderColor"
                                            Storyboard.TargetProperty="Color" To="#CB11AB"
                                            Duration="0:0:0.15"/>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
        </Border>
        
    </ControlTemplate>

    

</ResourceDictionary>
    